home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Printer / djf_for_3.0 / djint.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1992-10-19  |  2KB  |  80 lines

  1. #!/bin/sh
  2. # 4.2BSD line printer spooler interface for PostScript/TranScript printer
  3. # this is the printcap/lpd-invoked top level filter program for ALL file types
  4. # Copyright (c) 1985,1987 Adobe Systems Incorporated. All Rights Reserved. 
  5. # GOVERNMENT END USERS: See Notice file in TranScript library directory
  6. # -- probably /usr/lib/ps/Notice
  7. # RCSID: $Header: psint.proto,v 2.2 87/11/17 16:40:51 byron Rel $
  8.  
  9. PATH=/bin:/usr/bin:/usr/ucb
  10. export PATH
  11.  
  12. # set up initial undefined variable values
  13. width= length= indent= login= host= afile=
  14. prog=$0
  15. cwd=`pwd`
  16. pname=`basename $cwd`
  17.  
  18. # define the default printer-specific and TranScript
  19. # configuration options, these may be overridden by
  20. # real printer-specific options in the .options file
  21.  
  22. PSLIBDIR=//usr/lib/transcript
  23. REVERSE=//usr/lib/transcript/psrv
  24. VERBOSELOG=1
  25. BANNERFIRST=0
  26. BANNERLAST=0
  27. BANNERPRO=$PSLIBDIR/banner.pro
  28. PSTEXT=$PSLIBDIR/pstext
  29. PSCOMM=/usr/local/lib/djf
  30. export PSLIBDIR VERBOSELOG BANNERFIRST BANNERLAST BANNERPRO REVERSE PSTEXT
  31.  
  32. # load the values from the .options file if present
  33. test -r ./.options && . ./.options
  34.  
  35. # parse the command line arguments, most get ignored
  36. # the -hhost vs. -h host is due to one report of someone doing it wrong.
  37. # you could add or filter out non-standard options here (-p and -f)
  38.  
  39. while test $# != 0
  40. do    case "$1" in
  41.     -c)    ;;
  42.     -w*)    width=$1 ;;
  43.     -l*)    length=$1 ;;
  44.     -i*)    indent=$1 ;;
  45.     -x*)    width=$1 ;;
  46.     -y*)    length=$1 ;;
  47.     -n)    user=$2 ; shift ;;
  48.     -n*)    user=`expr $1 : '-.\(.*\)'` ;;
  49.     -h)    host=$2 ; shift ;;
  50.     -h*)    host=`expr $1 : '-.\(.*\)'` ;;
  51.     -*)    ;; 
  52.     *)    afile=$1 ;;
  53.     esac
  54.     shift
  55. done
  56.  
  57. PATH=$PSLIBDIR:$PATH
  58. export PATH
  59.  
  60. # now exec the format-specific filter, based on $prog
  61. # if - communications filter [default]
  62. # of - banner filter [execed directly]
  63. # nf - ditroff, tf - troff (CAT), gf - plot
  64. # vf - raster, df - TeX DVI, cf - cifplot, rf - fortran
  65.  
  66. prog=`basename $prog`
  67. #comm="$PSCOMM -P $pname -p $prog -n $user -h $host $afile"
  68. comm="$PSCOMM -n $user -h $host $afile"
  69.  
  70. case $prog in
  71.     djif) exec $comm ;;
  72.     djof) exec psbanner $pname ; exit 0 ;;
  73.     djnf) psdit | $comm ;;
  74.     djtf) pscat | $comm ;;
  75.     djgf) psplot | $comm ;;
  76.     djdf) dvips -f -r -D300 | $comm ;;
  77.     djvf|djcf|djrf) echo "$prog: filter not available." 1>&2  ;
  78.             psbad $prog $pname $user $host | $comm ;;
  79. esac
  80.